<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";

export default {
  name: "App",
  components: { ThemePicker },
  data() {
    return {
      appKey: 0,
      resizeTimer: null,
    };
  },
  mounted() {
    // 首次进入系统的提示
    //  this.$nextTick(() => {
    //   this.$alert('这是一个弹框', '提示', {
    //     confirmButtonText: '确定'
    //   });
    // });

    //窗口尺寸改变
    // window.onresize = () => {
    //   if (this.resizeTimer) {
    //     clearTimeout(this.resizeTimer)
    //   }
    //   this.resizeTimer = setTimeout(() => {
    //     this.appKey++
    //   }, 500)
    // }
  },
  destroyed() {
    window.onresize = null;
  },
  metaInfo() {
    return {
      title:
        this.$store.state.settings.dynamicTitle &&
        this.$store.state.settings.title,
      titleTemplate: (title) => {
        return title
          ? `${title} - ${process.env.VUE_APP_TITLE}`
          : process.env.VUE_APP_TITLE;
      },
    };
  },
};
</script>
<style scoped>
#app {
  /* background: #eff7fd url(~@/assets/image/commonImages/page-bg.png) no-repeat
    top center;
  background-size: 100% 100%; */
  overflow: auto;
}

#app .theme-picker {
  display: none;
}
</style>
